//Aaron Paterson
//LinkedConflict.h
//This is the .h file that runs the cpp file. Gives descriptions and a data design essentially.
//Coded by Aaron Paterson

#include <string>
#include <iostream>

using namespace std;

class Node
{
private:
	string instructor;
	int start;
	int end;
	string department;
	string section;
	string room;
	string building;
	int course;
	string day;



public:
	Node* next;
	Node() :next(NULL){};
	Node(string instructor, int start, int end, string department, string section, string room, string building, int course, string day)
		:instructor(instructor), start(start), end(end), department(department), section(section), room(room), building(building), course(course), day(day)
	{};

	void Node::Set(string instruct, int start, int end, string department, string section, string room, string building, int course, string day){
		this->instructor = instruct;
		this->start = start;
		this->end = end;
		this->department = department;
		this->section = section;
		this->room = room;
		this->building = building;
		this->course = course;
		this->day = day;
	}

	string getInstructor()
	{
		return instructor;
	};
	int getStart()
	{
		return start;
	};
	int getEnd()
	{
		return end;
	};
	string getDepartment()
	{
		return department;
	};
	string getSection()
	{
		return section;
	};
	string getRoom()
	{
		return room;
	};
	string getBuilding()
	{
		return building;
	};
	int getCourse()
	{
		return course;
	};
	string getDay()
	{
		return day;
	};

	void Node::setInstructor(string i){
		Set(i, this->getStart(), this->getEnd(), this->getDepartment(), this->getSection(), this->getRoom(),
			this->getBuilding(), this->getCourse(), this->getDay());
	}

	void Node::setStart(int s){
		Set(this->getInstructor(), s, this->getEnd(), this->getDepartment(), this->getSection(), this->getRoom(),
			this->getBuilding(), this->getCourse(), this->getDay());
	}

	void Node::setEnd(int e){
		Set(this->getInstructor(), this->getStart(), e, this->getDepartment(), this->getSection(), this->getRoom(),
			this->getBuilding(), this->getCourse(), this->getDay());
	}

	void Node::setDepartment(string d){
		Set(this->getInstructor(), this->getStart(), this->getEnd(), d, this->getSection(), this->getRoom(),
			this->getBuilding(), this->getCourse(), this->getDay());
	}

	void Node::setSection(string s){
		Set(this->getInstructor(), this->getStart(), this->getEnd(), this->getDepartment(), s, this->getRoom(),
			this->getBuilding(), this->getCourse(), this->getDay());
	}

	void Node::setRoom(string r){
		Set(this->getInstructor(), this->getStart(), this->getEnd(), this->getDepartment(), this->getSection(), r,
			this->getBuilding(), this->getCourse(), this->getDay());
	}

	void Node::setBuilding(string b){
		Set(this->getInstructor(), this->getStart(), this->getEnd(), this->getDepartment(), this->getSection(), this->getRoom(),
			b, this->getCourse(), this->getDay());
	}

	void Node::setCourseNumber(int c){
		Set(this->getInstructor(), this->getStart(), this->getEnd(), this->getDepartment(), this->getSection(), this->getRoom(),
			this->getBuilding(), c, this->getDay());
	}

	void Node::setDays(string d){
		Set(this->getInstructor(), this->getStart(), this->getEnd(), this->getDepartment(), this->getSection(), this->getRoom(),
			this->getBuilding(), this->getCourse(), d);
	}



};

class LinkedConflict
{
private:
	Node *head;
	Node *tail;

public:
	LinkedConflict();
	LinkedConflict(string instructor, int start, int end, string department, string section, string room, string building, int course, string day);
	~LinkedConflict();

	void buildLinked(string fileName);
	void appendLinked(string fileName, Node newNode);
	void conflictFinder(Node compareThis);
};